package com.huang825172.sbog.Tabs.Mine.MinePage.View;

import android.support.v7.widget.RecyclerView;
import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.huang825172.sbog.R;
import com.huang825172.sbog.Tabs.Mine.MinePage.Store.ViewDatas.VideoListItem;

import java.util.List;

public class MinePageRecyclerViewAdapter extends RecyclerView.Adapter<MinePageRecyclerViewAdapter.VH> {
    private List<VideoListItem> mData;

    public MinePageRecyclerViewAdapter(List<VideoListItem> data) {
        this.mData = data;
    }

    @NonNull
    @Override
    public VH onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
        View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.recyclerview_mine_page, viewGroup, false);
        return new VH(v);
    }

    @Override
    public void onBindViewHolder(@NonNull VH vh, int i) {
        vh.text.setText("hello " + new Integer(i).toString());
    }

    @Override
    public int getItemCount() {
        return mData.size();
    }

    public static class VH extends RecyclerView.ViewHolder {
        public final TextView text;

        public VH(View v) {
            super(v);
            text = (TextView) v.findViewById(R.id.MinePageListItemLikeNumTextViewI);
        }
    }
}

